package com.guazai.project.service.rpcimpl;

import com.guazai.common.pojo.InterfaceLog;
import com.guazai.common.rpc.InterfaceLogRPC;
import com.guazai.project.service.InterfaceLogService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

/**
 * @author qiteng
 */
@DubboService
@Slf4j
public class InterfaceLogRPCImpl implements InterfaceLogRPC {

    @Resource
    InterfaceLogService interfaceLogService;


    @Override
    public Boolean addLog(InterfaceLog interfaceLog) {
        if (interfaceLog == null) {
            return false;
        }

        log.info("记录接口调用日志：{}", interfaceLog);
        boolean save = interfaceLogService.save(interfaceLog);
        return save;
    }
}
